﻿using CSharpDay14.Data;
using CSharpDay14.Data.Model;
using CSharpDay14__Adapters_and_Interfaces_.Adapters.Interfaces;
using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Web;

namespace CSharpDay14__Adapters_and_Interfaces_.Adapters.Adapters
{
    public class UsersAdapter : IUsersAdapter
    {
        public List<User> GetAllUsers()
        {
            List<User> model;
            using (ApplicationDbContext db = new ApplicationDbContext())
            {
                model = db.SiteUsers.Include("Products").ToList();
            }
            return model;
        }
    }
}